package com.app.common.net.ly

import com.app.common.net.HttpProtocol
import org.jsoup.Jsoup
import org.jsoup.nodes.Document


open class LyApiResponseElements<T>(private val convert:(Document?)->T): HttpProtocol.Converter<T>{
    override fun onConvert(content: String?): T {
        val dc = try {
            Jsoup.parse(content)
        } catch (e: Exception) {
            null
        }
        return convert(dc)
    }
}